from django33.http import FileResponse, HttpResponse
from django33_ninja import NinjaAPI, Header

api = NinjaAPI()


# 返回HTML
@api.get("/test")
def hello_world(request):
    html="""
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>测试</title>
    </head>
    <body>
    <h1>欢迎同学们来到老师的直播间</h1>
    </body>
    </html>
"""
    return HttpResponse(
        html,
        content_type="text/html; charset=UTF-8",
    )
